const trans = {
  str2HotData: function(data) {
    if (!data.length) {
      return []
    }
    let jsonData = JSON.parse(data)
      // window.console && console.log(jsonData);
    let hotData = []
    for (let x in jsonData) {
      let row = []
      for (let y in jsonData[x]) {
        row.push(jsonData[x][y])
      }
      hotData.push(row)
    }
    // window.console && console.log(hotData);
    return hotData
  },
  hotData2Str: function(data) {
    let str = {}
    for (let x in data) {
      let row = (Number(x) + 1).toString()
      str[row] = {}
      for (let y in data[x]) {
        let col = String.fromCharCode(65 + Number(y))
        str[row][col] = data[x][y] //此处需要把值转为unicode
      }
    }
    return JSON.stringify(str)
  },
}

export default trans
